<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Role
 *
 * @author root
 */

class Auth_Controller_Admin_Role extends MVC_AbstractAdminController
{
    public function index()
    {
        $html  = '<div class="row-fluid sortable">';
        
        $html .=    '<div class="box span12">';
        
        $html .=        '<div class="box-header well" data-original-title><h2><i class="icon-user"></i>Roles</h2></div>';
                         
       // $html .=            $this->tableToolbox('<a class="btn btn-success" href="'.$this->getLink('Auth', 'Role', 'add').'"><i class="icon-plus icon-white"></i> Add Role</a>');
           
        $html .=            '<div class="box-content">';
         
        $html .=                '<table class="table table-striped table-bordered">';
                                
        $html .=                    '<thead>';
            
        $html .=                        '<tr>';                                
                                                  
        $html .=                            '<th style="width:200px">ID</th>';
                                                    
        $html .=                            '<th>Name</th>';
        
        $html .=                            '<th style="width:200px">Actions</th>';
                               
        $html .=                        '</tr>';
        
        $html .=                    '</thead>';
                                      
        $html .=                    '<tbody>';  
        
        $html .=                    '</tbody>';
        
        $html .=                '</table>';   
        
        $html .=            '</div>';
        
        $html .=        '</div>';
        
        $html .=    '</div>';
        
        return $html;
    }
    
    public function add()
    {
        return $this->roleForm();
       
    }
    
    private function roleForm($id = false)
    {
        
        if($id)
        {
            $title = 'Edit Role';
        }
        else
        {
            $title = 'Add Role';
        }
        
        $html  = '<div class="row-fluid">';
        
        $html .=    '<div class="box span12">';
        
        $html .=        '<div class="box-header well" data-original-title="">';
        
        $html .=            '<h2><i class="icon-edit"></i> '.$title.'</h2>';
        
        $html .=        '</div>';
        
        $html .=        '<div class="box-content">';
        
        $html .=            '<form class="form-horizontal"';
        
        $html .=                '<fieldset>';
        ;
        $html .=                '<div class="control-group">';
                                    
        $html .=                    '<label class="control-label" for="name">Role Name</label>';
        
	$html .=                    '<div class="controls">';
								 
        $html .=                        '<input class="input-xlarge focused" name="role_name" id="role_name" type="text" value="">';
        
	$html .=                    '</div>';
	
        $html .=                '</div>';
	
        $html .=                '<div class="form-actions">';
        
	$html .=                    '<button type="submit" class="btn btn-primary">Save changes</button>&nbsp;';
        
	$html .=                    '<a class="btn" href="'.$this->getLink('Auth', 'Role', 'index').'"><i class="icon-arrow-left"></i> Back</a>';
        
	$html .=                '</div>';
        
        $html .=                '</fieldset>';
        
        $html .=            '</form>';
        
        $html .=        '</div>';
        
        $html .=    '</div>';
        
        $html .= '</div>';
        
        return $html;
    }
}

